<?php

$cmd = '/var/www/html/badge/cgi-bin/wkhtmltoimage --crop-h 687 --crop-w 395 --crop-x 5 --crop-y 5 http://wormgear.us.to/badge/print_badge_9.php /tmp/test5.png 2>&1';

exec($cmd, $output);

// Printing additional info

echo '<pre>';
//var_dump($output);
foreach ($output as $i =>$read){
   echo "$read - $i \n";
}
echo '</pre>';
?>